const http = require("http");
const url = require("url");
class Service{
	constructor(conf){
		this.hostname = conf.hostname;
		this.port = conf.port;
	}
	run(callback){
		let self = this;
		let serv = http.createServer(callback);
			serv.listen(this.port, this.hostname, function(){
				console.log("Service running! "+self.hostname+":"+self.port);
			});
	}
}
exports.run = function(conf, callback){
	let serv = new Service(conf);
		serv.run(callback);
}